package com.cip.email.picasa.email;

import static com.google.common.collect.Lists.newArrayList;

import java.util.List;

import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

import de.saxsys.roo.equals.addon.RooEquals;

@RooToString
@RooJavaBean
@RooEquals
public class Email {
	private String from;
	private List<String> to = newArrayList();
	private String subject;
	private String body;
	private List<ImageAttachment> attachments = newArrayList();

	public static class Builder {
		private String from;
		private List<String> to;
		private String subject;
		private String body;
		private List<ImageAttachment> attachments;

		public Builder from(String from) {
			this.from = from;
			return this;
		}

		public Builder to(List<String> to) {
			this.to = to;
			return this;
		}

		public Builder subject(String subject) {
			this.subject = subject;
			return this;
		}

		public Builder body(String body) {
			this.body = body;
			return this;
		}

		public Builder attachments(List<ImageAttachment> attachments) {
			this.attachments = attachments;
			return this;
		}

		public Email build() {
			Email email = new Email();
			email.from = from;
			email.to = to;
			email.subject = subject;
			email.body = body;
			email.attachments = attachments;
			return email;
		}
	}
}